﻿//-----------------------------------------------------------------------
// <copyright file="LogOptions.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: LogOptions.cs
// * history : created by qinchaoyue 2017-12-20 06:39:29
// </copyright>
//-----------------------------------------------------------------------

namespace Slwy.Logger.Models
{
    using System;
    using System.IO;

    using Slwy.Logger.Implements.Elasticsearch;

    /// <summary>
    /// The log options.
    /// 日志配置项
    /// </summary>
    public class LogOptions
    {
        /// <summary>
        /// 日志输出路径
        /// </summary>
        public string File { get; set; } = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");

        /// <summary>
        /// 日志级别 Debug, Info, Warn, Error. 如果不填则默认 Error
        /// Debug 将输出 Debug, Info, Warn和Error  4
        /// Info  将输出 Info, Warn和Error           3
        /// Warn 将输出 Warn和Error                  2
        /// Error 只输出 Error                      1
        /// </summary>
        public string LogLevel { get; set; } = "Error";

        /// <summary>
        /// 日志收集间隔. 每隔指定分钟生成一个新的日志文件.
        /// </summary>
        public int StatisticsTimeInterval { get; set; } = 5;

        /// <summary>
        /// 单个日志文件最大size
        /// 默认 10MB
        /// </summary>
        public string MaximumFileSize { get; set; } = "10MB";

        /// <summary>
        /// es 配置项
        /// </summary>
        // ReSharper disable once InconsistentNaming
        public ESOptions ESOptions { get; set; } = new ESOptions();
    }
}
